#include <p24fj64GA006.h>
#include <stdio.h>
#include "def_bits.h"
#include "def_fonctions.h"

int main (void){	
//	ADPCFG = 0xFFFF; // Force all ADC pins as digital I/O

	init();
	InitSPI();

	LED1=0;
	LED2=0;
	LED3=0;
	LED4=0;
	unsigned char etat = 0;

	do{
	if(SPI1STATbits.SPIRBF){
	etat = SPIRead();
	PORTB = etat;
	}
	}while(1);

	return 0;
}